#define _CRT_SECURE_NO_WARNINGS
#include <iostream>
using namespace std;
#include <vector>
int main()
{
    int n;
    cin >> n;
    vector<int> arr(n, 0);
    for (int i = 0; i < n; i++)
        arr[i] = i + 1;
    int left = 0, right = n - 1;
    while (left < right)
    {
        cout << arr[left++] << " ";
        cout << arr[right--] << " ";
    }
    if (left == right)
    {
        cout << arr[left];
    }
    return 0;
}

#include <iostream>
using namespace std;
#include <vector>
int main() {
    string s;
    cin >> s;
    int n = s.size();
    vector<vector<int>> dp(n, vector<int>(n, 0));
    for (int i = n - 1; i >= 0; i--)
    {
        for (int j = 0; j < n; j++)
        {
            if (i > j)
            {
                continue;
            }
            else if (i == j)
                dp[i][j] = 1;
            else
            {
                if (s[i] == s[j])
                {
                    dp[i][j] = dp[i + 1][j - 1] + 2;
                }
                else {
                    dp[i][j] = max(dp[i][j - 1], dp[i + 1][j]);
                }
            }
        }

    }
    cout << dp[0][n - 1] << endl;
    return 0;
}